﻿#region Copyright (c) 2000-2013 Developer Express Inc.
/*
{*******************************************************************}
{                                                                   }
{       Developer Express .NET Component Library                    }
{                                                                   }
{                                                                   }
{       Copyright (c) 2000-2013 Developer Express Inc.              }
{       ALL RIGHTS RESERVED                                         }
{                                                                   }
{   The entire contents of this file is protected by U.S. and       }
{   International Copyright Laws. Unauthorized reproduction,        }
{   reverse-engineering, and distribution of all or any portion of  }
{   the code contained in this file is strictly prohibited and may  }
{   result in severe civil and criminal penalties and will be       }
{   prosecuted to the maximum extent possible under the law.        }
{                                                                   }
{   RESTRICTIONS                                                    }
{                                                                   }
{   THIS SOURCE CODE AND ALL RESULTING INTERMEDIATE FILES           }
{   ARE CONFIDENTIAL AND PROPRIETARY TRADE                          }
{   SECRETS OF DEVELOPER EXPRESS INC. THE REGISTERED DEVELOPER IS   }
{   LICENSED TO DISTRIBUTE THE PRODUCT AND ALL ACCOMPANYING .NET    }
{   CONTROLS AS PART OF AN EXECUTABLE PROGRAM ONLY.                 }
{                                                                   }
{   THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED      }
{   FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE        }
{   COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE       }
{   AVAILABLE TO OTHER INDIVIDUALS WITHOUT EXPRESS WRITTEN CONSENT  }
{   AND PERMISSION FROM DEVELOPER EXPRESS INC.                      }
{                                                                   }
{   CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON       }
{   ADDITIONAL RESTRICTIONS.                                        }
{                                                                   }
{*******************************************************************}
*/
#endregion Copyright (c) 2000-2013 Developer Express Inc.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UColor.Core.Helpers;
namespace UColor.WPF {
	public enum BaseControlPage { None,  ModulesPage, MainPage }
	public class BaseControlState : BindingAndDisposable {
		BaseControlPage page = BaseControlPage.None;
		object productID;
		object moduleID;
		bool showBackButton;
		bool optionsIsExpanded = true;
		DemoModuleControlOptionsView optionsView;
		bool showBuyNowButton;
		public event ThePropertyChangedEventHandler<BaseControlPage> PageChanged;
		public event ThePropertyChangedEventHandler<object> ProductIDChanged;
		public event ThePropertyChangedEventHandler<object> ModuleIDChanged;
		public event ThePropertyChangedEventHandler<bool> ShowBackButtonChanged;
		public event ThePropertyChangedEventHandler<bool> ShowBuyNowButtonChanged;
		public event ThePropertyChangedEventHandler<bool> OptionsIsExpandedChanged;
		public event ThePropertyChangedEventHandler<DemoModuleControlOptionsView> OptionsViewChanged;
		public BaseControlPage Page {
			get { return page; }
			set { SetValue<BaseControlPage>("Page", ref page, value, RaisePageChanged); }
		}
		public DemoModuleControlOptionsView OptionsView {
			get { return optionsView; }
			set { SetValue<DemoModuleControlOptionsView>("OptionsView", ref optionsView, value, RaiseOptionsViewChanged); }
		}
		public bool OptionsIsExpanded {
			get { return optionsIsExpanded; }
			set { SetValue<bool>("OptionsIsExpanded", ref optionsIsExpanded, value, RaiseOptionsIsExpanded); }
		}
		public object ProductID {
			get { return productID; }
			set { SetValue<object>("ProductID", ref productID, value, RaiseProductIDChanged); }
		}
		public object ModuleID {
			get { return moduleID; }
			set { SetValue<object>("ModuleID", ref moduleID, value, RaiseModuleIDChanged); }
		}
		public bool ShowBackButton {
			get { return showBackButton; }
			set { SetValue<bool>("ShowBackButton", ref showBackButton, value, RaiseShowBackButtonChanged); }
		}
		public bool ShowBuyNowButton {
			get { return showBuyNowButton; }
			set { SetValue<bool>("ShowBuyNowButton", ref showBuyNowButton, value, RaiseShowBuyNowButtonChanged); }
		}
		void RaiseOptionsIsExpanded(bool oldValue, bool newValue) {
			if(OptionsIsExpandedChanged != null)
				OptionsIsExpandedChanged(this, new ThePropertyChangedEventArgs<bool>(oldValue, newValue));
		}
		void RaisePageChanged(BaseControlPage oldValue, BaseControlPage newValue) {
			if(PageChanged != null)
				PageChanged(this, new ThePropertyChangedEventArgs<BaseControlPage>(oldValue, newValue));
		}
		void RaiseProductIDChanged(object oldValue, object newValue) {
			if(ProductIDChanged != null)
				ProductIDChanged(this, new ThePropertyChangedEventArgs<object>(oldValue, newValue));
		}
		void RaiseModuleIDChanged(object oldValue, object newValue) {
			if(ModuleIDChanged != null)
				ModuleIDChanged(this, new ThePropertyChangedEventArgs<object>(oldValue, newValue));
		}
		void RaiseShowBackButtonChanged(bool oldValue, bool newValue) {
			if(ShowBackButtonChanged != null)
				ShowBackButtonChanged(this, new ThePropertyChangedEventArgs<bool>(oldValue, newValue));
		}
		void RaiseShowBuyNowButtonChanged(bool oldValue, bool newValue) {
			if(ShowBuyNowButtonChanged != null)
				ShowBuyNowButtonChanged(this, new ThePropertyChangedEventArgs<bool>(oldValue, newValue));
		}
		void RaiseOptionsViewChanged(DemoModuleControlOptionsView oldValue, DemoModuleControlOptionsView newValue) {
			if(OptionsViewChanged != null)
				OptionsViewChanged(this, new ThePropertyChangedEventArgs<DemoModuleControlOptionsView>(oldValue, newValue));
		}
	}
}
